﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin.master" AutoEventWireup="true" CodeFile="Quanly_sanphamgiamgia.aspx.cs" Inherits="Admin_Sanphamgiamgia_Quanly_sanphamgiamgia" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:Label ID="Label1" runat="server" BackColor="White" Font-Bold="True" 
        Font-Size="X-Large" ForeColor="#FF3300" Text="Quản Lý Sản Phẩm Giảm Giá"></asp:Label>
    <br />
    Theo Thể loại:
    <asp:DropDownList ID="tloai" runat="server" AutoPostBack="True" 
        DataSourceID="LinqDataSource1" DataTextField="Ten_tloai" 
        DataValueField="Id_tloai">
    </asp:DropDownList>
    <asp:LinqDataSource ID="LinqDataSource1" runat="server" 
        ContextTypeName="DLL.luuliDataContext" EntityTypeName="" TableName="theloais">
    </asp:LinqDataSource>
    <br />
    <br />
    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
        AutoGenerateColumns="False" BackColor="White" BorderColor="#999999" 
        BorderStyle="None" BorderWidth="1px" CellPadding="3" DataKeyNames="Id_sp" 
        DataSourceID="LinqDataSource2" GridLines="Vertical">
        <AlternatingRowStyle BackColor="Gainsboro" />
        <Columns>
            <asp:BoundField DataField="Id_sp" HeaderText="Mã" InsertVisible="False" 
                ReadOnly="True" SortExpression="Id_sp" />
            <asp:BoundField DataField="Ten_sp" HeaderText="Tên" SortExpression="Ten_sp" />
            <asp:BoundField DataField="Giagoc_sp" HeaderText="Giá gốc" 
                SortExpression="Giagoc_sp" />
            <asp:BoundField DataField="Giaban_sp" HeaderText="Giá bán" 
                SortExpression="Giaban_sp" />
            <asp:BoundField DataField="Phantramgiam_sp" HeaderText="Phần trăm " 
                SortExpression="Phantramgiam_sp" />
            <asp:BoundField DataField="Ngaybatdau_sp" HeaderText="Ngày bắt đầu" 
                SortExpression="Ngaybatdau_sp" />
            <asp:BoundField DataField="Ngayketthuc_sp" HeaderText="Ngày kết thúc" 
                SortExpression="Ngayketthuc_sp" />
            <asp:TemplateField HeaderText="Loại">
            <ItemTemplate>
            <%# Eval("sanpham_loai2.Ten_sploai2") %>
            </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Nhà cung cấp">
            <ItemTemplate>
            <%# Eval("congty.ten_cty") %>
            </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Cập nhật">
                <ItemTemplate>
                    <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%#"~/Admin/Sanphamgiamgia/Capnhat_sanphamgiamgia.aspx?id=" + Eval("Id_sp") %>' Text="Cập nhật"></asp:HyperLink>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Xóa">
                <ItemTemplate>
                    <asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl="" Text="Xóa"></asp:HyperLink>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
        <FooterStyle BackColor="#CCCCCC" ForeColor="Black" />
        <HeaderStyle BackColor="#000084" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
        <RowStyle BackColor="#EEEEEE" ForeColor="Black" />
        <SelectedRowStyle BackColor="#008A8C" Font-Bold="True" ForeColor="White" />
        <SortedAscendingCellStyle BackColor="#F1F1F1" />
        <SortedAscendingHeaderStyle BackColor="#0000A9" />
        <SortedDescendingCellStyle BackColor="#CAC9C9" />
        <SortedDescendingHeaderStyle BackColor="#000065" />
    </asp:GridView>
    <asp:LinqDataSource ID="LinqDataSource2" runat="server" 
        ContextTypeName="DLL.luuliDataContext" EntityTypeName="" 
        TableName="sanphamgiamgias" Where="Id_tloai == @Id_tloai">
        <WhereParameters>
            <asp:ControlParameter ControlID="tloai" Name="Id_tloai" 
                PropertyName="SelectedValue" Type="Int32" />
        </WhereParameters>
    </asp:LinqDataSource>
    <br />
</asp:Content>

